package com.teamclub.erp.scontrollers

import com.teamclub.erp.sservices.ErpPayService
import com.teamclub.pay.sforms.PayOrderForm
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}


@RestController("com.teamclub.erp.scontrollers.ErpPayController")
@RequestMapping(Array("/erp/pay"))
class ErpPayController {
  @Autowired
  var erpPayService: ErpPayService = _
  @PostMapping(Array("appPay"))
  def appPay(@RequestBody form: PayOrderForm) = {
    Eithers.toJson(erpPayService.appPay(form))
  }
  @PostMapping(Array("thirdQueryOrder"))
  def payThirdQuery(@RequestBody form: PayOrderForm) = {
    Eithers.toJson(erpPayService.payThirdQuery(form))
  }

}
